package com.yuexun.dhdoctor.module.Contract.model.impl;


import com.yuexun.dhdoctor.module.Contract.api.ManageGroupApi;
import com.yuexun.dhdoctor.module.Contract.bean.DeleteGroupBean;
import com.yuexun.dhdoctor.module.Contract.model.IManageGroupModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/7/26.
 */
public class ManageGroupModel implements IManageGroupModel {
    private ManageGroupApi api;

    public ManageGroupApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(ManageGroupApi.class);
        }
    }

    @Override
    public Observable<DeleteGroupBean> deleteGroup(Map<String, String> praise) {
        api = ApiInstance();
        return api.deleteGroup(praise);
    }

    @Override
    public Observable<DeleteGroupBean> updateGroup(Map<String, String> praise) {
        api = ApiInstance();
        return api.updateGroup(praise);
    }
}
